package com.linkivr.model;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
public class T_user {
	private int user_id;			//用户编号
	private String user_name;		//用户名称
	private String user_passwd;		//用户密码
	private T_group group;		//组编号
	
	@Id
	@GeneratedValue
	public int getUser_id() {
		return user_id;
	}
	public void setUser_id(int userId) {
		user_id = userId;
	}
	public String getUser_name() {
		if (user_name==null)
			return "";
		return user_name;
	}
	public void setUser_name(String userName) {
		user_name = userName;
	}
	public String getUser_passwd() {
		if (user_passwd==null)
			return "";
		return user_passwd;
	}
	public void setUser_passwd(String userPasswd) {
		user_passwd = userPasswd;
	}
	
	@ManyToOne(fetch=FetchType.EAGER,cascade=CascadeType.ALL)
	@JoinColumn(name = "group_id")
	public T_group getGroup() {
		return group;
	}
	public void setGroup(T_group group) {
		this.group = group;
	}
	
}
